<template>
    <div id="AsnDetail">
        <div class="detail">
            <component :inputData="detailData" :is="currentComponent"></component>
        </div>
    </div>

</template>

<script>
import detail from "commons/Detail";
import navMenu from "commons/NavMenu";
import baseMixin from "@/mixins/BaseMixin";

export default {
    name: "Detail",
    mixins: [baseMixin],
    data() {
        return {
            newFlag: true,
            selectData: {},
            detailData: {
                locationtype: "",
            },
            detailNav: "1",
            temporary: {},
            componentConfig: [
                {
                    name: "GatherDetail",
                    label: this.$t('common.info'),
                    component: () => import('./page/particulars.vue')
                },
            ]
        }
    },
    computed: {
        currentComponent() {
            return this.componentConfig[this.detailNav - 1].component;
        }
    },
    methods: {
        async getData() {
            let str = ""
            if (this.$route.query.queryPageFlag === "querybulider") {
                str = this.selectData.interactionid
            } else {
                str = this.selectData.filterid
            }
            try {
                let res = await this.$api.post(`/showOrdersList/${str}/${this.selectData.rtxwavetype}/${this.$route.query.queryPageFlag}/1/${this.selectData.orderNumber}/${this.selectData.orderQty}/${this.selectData.rtxexternaltype}`, this.selectData);
                
                    this.detailData = {
                        ...this.detailData,
                        ...res.bean
                    }
                
            } catch (e) {
                this.$message.error(e);
            }
        }
    },
    mounted() {

        this.selectData = this.$store.state.routeData;
        let options = this.getOptions("querycodeLkup/RTXWAVETYPE");
        options.forEach(item => {
            if (item.code == this.selectData.rtxwavetype) {
                this.detailData.locationtype = item.description
            }
        })
        this.getData();


    },
    components: {
        "v-detail": detail,
        "v-navMenu": navMenu,
    },

}
</script>

<style scoped>

</style>
